//
//  LLFullScreenLoading.swift
//  LaiLang
//
//  Created by David on 2017/2/5.
//  Copyright © 2017年 David. All rights reserved.
//

import UIKit

class LLFullScreenLoading: UIView {

    var indicator: UIActivityIndicatorView!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        let bg = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
        bg.center = CGPoint(x: frame.width/2, y: frame.height/2)
        bg.backgroundColor = UIColor(white: 0, alpha: 0.6)
        bg.layer.cornerRadius = 5
        addSubview(bg)
        
        indicator = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
        indicator.center = CGPoint(x: 25, y: 25)
        indicator.activityIndicatorViewStyle = .white
        indicator.startAnimating()
        bg.addSubview(indicator)
        
        
//        spinnerBG = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
//        spinnerBG.center = view.center
//        spinnerBG.backgroundColor = UIColor(white: 0, alpha: 0.75)
//        spinnerBG.layer.cornerRadius = 5
//        view.addSubview(spinnerBG)
//        let spinner = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
//        spinner.center = CGPoint(x: 25, y: 25)
//        spinner.activityIndicatorViewStyle = .white
//        spinner.startAnimating()
//        spinnerBG.addSubview(spinner)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
